package com.mzj.saas.commons;

public class BankBo {

	private String mchId;
	private String partnerTradeNo;
	private String nonceStr;
	private String sign;
	private String encBankNo;
	private String encTrueName;
	private String bankCode;
	private Integer amount;
	private String desc;
	private String key;

	public String getMchId() {
		return mchId;
	}

	public void setMchId(String mchId) {
		this.mchId = mchId;
	}

	public String getPartnerTradeNo() {
		return partnerTradeNo;
	}

	public void setPartnerTradeNo(String partnerTradeNo) {
		this.partnerTradeNo = partnerTradeNo;
	}

	public String getNonceStr() {
		return nonceStr;
	}

	public void setNonceStr(String nonceStr) {
		this.nonceStr = nonceStr;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getEncBankNo() {
		return encBankNo;
	}

	public void setEncBankNo(String encBankNo) {
		this.encBankNo = encBankNo;
	}

	public String getEncTrueName() {
		return encTrueName;
	}

	public void setEncTrueName(String encTrueName) {
		this.encTrueName = encTrueName;
	}

	public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getSignStr() {
		StringBuilder sb = new StringBuilder();
		sb.append("amount=").append(amount).append("&");
		sb.append("bank_code=").append(bankCode).append("&");
		sb.append("desc=").append(desc).append("&");
		sb.append("enc_bank_no=").append(encBankNo).append("&");
		sb.append("enc_true_name=").append(encTrueName).append("&");
		sb.append("mch_id=").append(mchId).append("&");
		sb.append("nonce_str=").append(nonceStr).append("&");
		sb.append("partner_trade_no=").append(partnerTradeNo).append("&");
		sb.append("key=").append(key).append("&");

		return sb.toString();
	}

	public String getXML() {
		StringBuilder sb = new StringBuilder();
		sb.append("<xml>");
		sb.append("<amount>").append(amount).append("</amount>");
		sb.append("<bank_code>").append(bankCode).append("</bank_code>");
		sb.append("<desc>").append(desc).append("</desc>");
		sb.append("<enc_bank_no>").append(encBankNo).append("</enc_bank_no>");
		sb.append("<enc_true_name>").append(encTrueName).append("</enc_true_name>");
		sb.append("<mch_id>").append(mchId).append("</mch_id>");
		sb.append("<nonce_str>").append(nonceStr).append("</nonce_str>");
		sb.append("<partner_trade_no>").append(partnerTradeNo).append("</partner_trade_no>");
		sb.append("<sign>").append(sign).append("</sign>");
		sb.append("</xml>");
		return sb.toString();
	}

	public String toJson() {
		return "{\"mchId\":\"" + mchId + "\",\"partnerTradeNo\":\"" + partnerTradeNo + "\",\"nonceStr\":\"" + nonceStr
				+ "\",\"sign\":\"" + sign + "\",\"encBankNo\":\"" + encBankNo + "\",\"encTrueName\":\"" + encTrueName
				+ "\",\"bankCode\":\"" + bankCode + "\",\"amount\":\"" + amount + "\",\"desc\":\"" + desc + "\"}";
	}

}
